/*
* @Author: dengjiayao
* @Date:   2017-12-18 17:18:23
* @Last Modified by:   dengjiayao
* @Last Modified time: 2017-12-20 16:31:17
*/
import Vue from './vue'
import store from './vuex/store'
import { alert } from 'vue-strap'
import loginCheck from './util/login-check'
import SubscribeList from './classes/subscribe-list/subscribe-list.vue'
import SubscribeConfig from './classes/subscribe-config/subscribe-config.vue'

new Vue({
  el: 'body',
  components: {
    'vue-alert-msg': alert,
    'vue-list': SubscribeList,
    'vue-config': SubscribeConfig
  },
  store,
  created() {
    loginCheck(this)
  },
  vuex: {
    getters: {
      msg: state => state.msg
    }
  },
  methods: {
    addItem() {
      let ref = this.$refs.subscribeConfig
      ref.actionType = 'ADD'
      ref.form = {
        phone: '',
        courseId: '',
        dateNum: ''
      }
      ref.showModal = true
    }
  }
})
